package com.jf.mall.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.UUID;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2024-10-10
 * Time:18:57
 */
public class Order {
    //1.id
    //2.用户id
    //3.总金额
    //4.下单时间
    //5.订单状态	0-已下单 1-已发货 2-已签收
    private String id;
    private Integer userId;
    private BigDecimal amount;
    private Date orderTime;
    private Short state;
    public Order() {
    }

    public Order(Integer userId, BigDecimal amount) {
        this(userId, amount, (short)0);
    }

    public Order(Integer userId, BigDecimal amount, Short state) {
        this.userId = userId;
        id = String.valueOf(UUID.randomUUID()) + userId;
        this.amount = amount;
        orderTime = new Date();
        this.state = state;
    }

    public String getId() {
        return id;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public Integer getUserId() {
        return userId;
    }

    public Date getOrderTime() {
        return orderTime;
    }

    public Short getState() {
        return state;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    public void setState(Short state) {
        this.state = state;
    }
}
